package com.lq.ecoldchain.internet

import com.lq.ecoldchain.entity.*
import io.reactivex.Observable
import io.reactivex.internal.operators.observable.ObservableElementAt
import okhttp3.ResponseBody
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query
import retrofit2.http.QueryMap

interface APIService {

    @POST("user/login")
    fun login(@Query("phone") phone: String, @Query("loginPassword") password: String): Observable<ResultEntity<String>>

    @GET("user/signOut")
    fun signOut(): Observable<ResultEntity<String>>

    @POST("user/register")
    fun register(@QueryMap map: HashMap<String, String>): Observable<ResultEntity<String>>

    @POST("user/resetPassword")
    fun resetPassword(@Query("phone") phone: String, @Query("code") code: String, @Query("loginPassword") loginPassword: String): Observable<ResultEntity<String>>

    @GET("verificationCode/resetPassword")
    fun sendResetPasswordCode(@Query("phone") phone: String): Observable<ResultEntity<String>>

    @GET("verificationCode/register")
    fun sendRegisterCode(@Query("phone") phone: String): Observable<ResultEntity<String>>

    @GET("verificationCode/modifyPhone")
    fun sendUpdatePhoneOldCode(@Query("phone") phone: String): Observable<ResultEntity<String>>

    @GET("verificationCode/bindNewPhone")
    fun sendUpdatePhoneNewCode(@Query("phone") phone: String): Observable<ResultEntity<String>>

    @GET("verificationCode/setPayPassword")
    fun sendPayPasswordCode(@Query("phone") phone: String): Observable<ResultEntity<String>>

    @GET("user/information")
    fun requestUserInfo(): Observable<ResultEntity<UserInfoBean>>

    @GET("account/aggregateAmount")
    fun requestAccountInfo(): Observable<ResultEntity<Double>>

    @POST("feedback")
    fun feedback(@Query("phone") phone: String, @Query("content") content: String): Observable<ResultEntity<String>>

    @GET("enter/basicInfo")
    fun enterBasicData(): Observable<ResultEntity<EnterInfoBean>>

    @POST("enter/apply")
    fun enterApply(@QueryMap() map: HashMap<String, String>): Observable<ResultEntity<String>>

    @GET("qiniu/getUpToken")
    fun getUpToken(): Observable<ResultEntity<QiNiuToken>>

    @POST("certificationPersonal/submitAudit")
    fun submitAudit(@QueryMap() map: HashMap<String, String>): Observable<ResultEntity<String>>

    @GET("msg/list")
    fun obtainMsgList(@Query("page") page: Int, @Query("limit") limit: Int): Observable<ResultEntity<MessageBean>>

    @GET("ruleVehicleType/list")
    fun obtainCarTypeData(): Observable<CarTypeListBean>//list 数组

    @POST("truck/add")
    fun addTrack(@QueryMap() map: HashMap<String, Any>): Observable<ResultEntity<String>>

    @GET("driverFollowCity/list")
    fun obtainCarAllLine(): Observable<ResultEntity<List<CityInfo>>>

    @GET("truck/get")
    fun getTruck(): Observable<ResultEntity<CarInfoEntity>>

    @GET("certificationPersonal/getInfo")
    fun getCertification(): Observable<ResultEntity<CertificationEntity>>

    @POST("driverRoute/add")
    fun addLine(@Query("startCity") startCity: Int, @Query("endCity") endCity: Int): Observable<ResultEntity<String>>

    @GET("city/list")
    fun obtainCityAll(): Observable<ResultEntity<List<City>>>

    @GET("driverCredential/list")
    fun driverCertificationList(): Observable<ResultEntity<List<CertificationEntity>>>

    @GET("driverFollowCity/remove")
    fun removeDriverRoute(@Query("id") id: Int): Observable<ResultEntity<String>>

    @GET("user/inviteCode")
    fun obtainRecommendCode(): Observable<ResultEntity<String>>

    @GET("user/getInvitedFriends")
    fun obtainRecommendPerson(): Observable<ResultEntity<List<RecommendEntity>>>

    @POST("user/modifyPhoneValidate")
    fun modifyPhoneValidate(@Query("code") code: String): Observable<ResultEntity<String>>

    @POST("user/bindNewPhone")
    fun bindPhoneNew(@Query("modifyPhoneToken") phoneToken: String, @Query("newPhone") newPhone: String, @Query("code") code: String): Observable<ResultEntity<String>>

    @POST("user/setPayPassword")
    fun setPayPassword(@Query("payPassword") payPassword: String, @Query("code") code: String): Observable<ResultEntity<String>>

    @GET("account/withdrawDepositLog")
    fun obtainWithdrawHistory(@Query("page") page: String, @Query("limit") limit: String): Observable<ResultEntity<WithDrawBean>>

    @GET("bankCard/list")
    fun bankCardList(): Observable<ResultEntity<List<BankCardEntity>>>

    @POST("bankCard/tying")
    fun addCard(@QueryMap() map: HashMap<String, String>): Observable<ResultEntity<String>>

    @POST("introduce/submit")
    fun submitIntroduce(@QueryMap() map: HashMap<String, Any>): Observable<ResultEntity<String>>

    @GET("goodsType/list")
    fun obtainGoodsTypeList(): Observable<ResultEntity<List<GoodsTypeBean>>>

    @POST("account/withdrawDeposit")
    fun submitWithdraw(@Query("payPassword") payPassword: String, @Query("money") money: String, @Query("bankCardId") bankCardId: String): Observable<ResultEntity<String>>

    @GET("order/recommend")
    fun orderRecommend(@Query("page") page: Int, @Query("limit") limit: Int): Observable<ResultEntity<RecommendBean>>

    @POST("order/taking")
    fun takeOrder(@Query("orderId") orderId: String, @Query("payPassword") payPassword: String, @Query("paySumFee") paySumFee: String): Observable<ResultEntity<String>>

    @GET("order/details")
    fun orderDetail(@Query("orderId") orderId: Int): Observable<ResultEntity<OrderDetailBean>>

    @POST("driverCredential/add")
    fun addCertification(@Query("name") name: String, @Query("credentialNo") credentialNo: String, @Query("credentialFaceImg") credentialFaceImg: String): Observable<ResultEntity<String>>

    @POST("driverFollowCity/add")
    fun addFollowCity(@Query("city") city: Int): Observable<ResultEntity<String>>

    @POST("user/updateCurrentCity")
    fun updateCurrentCity(@Query("currentCity") currentCity: String): Observable<ResultEntity<String>>

    @GET("order/listTaking")
    fun orderListTaking(@Query("status") status: String, @Query("page") page: Int, @Query("limit") limit: Int): Observable<ResultEntity<TakeOrderListEntity>>

    @POST("order/cargoHandling")
    fun cargoHanding(@Query("id") id: Int, @Query("explain") explain: String, @Query("imgs") imgs: String): Observable<ResultEntity<String>>

    @GET("order/receivables")
    fun obtainCode(@Query("id") id: Int, @Query("payWay") payWay: Int): Observable<ResultEntity<String>>

    @POST("order/distributionPerfect")
    fun orderOver(@Query("id") id: String, @Query("receipt") receipt: String, @Query("temperatureController") temperatureController: String, @Query("oilCard") oilCard: String): Observable<ResultEntity<String>>

    @GET("user/mileage")
    fun mileage(): Observable<ResultEntity<String>>

    @GET("user/mileage/list")
    fun mileageDetail(@Query("page") page: Int, @Query("limit") limit: Int): Observable<ResultEntity<List<MileageDetailBean>>>

    @GET("user/mileage/ranking/list")
    fun mileageRanking(@Query("page") page: Int, @Query("limit") limit: Int): Observable<ResultEntity<List<MileageRankingBean>>>

    @GET("user/mileage/myMileageRanking")
    fun myMileageRanking():Observable<ResultEntity<String>>

    @GET("account/recharge/alipay")
    fun rechargeAliPay(@Query("subject")subject:String,@Query("totalAmount")totalAmount:String):Observable<ResultEntity<AliPayBean>>

    @GET("recharge/alipay/validate")
    fun validateAliPay(@Query("outTradeNo")outTradeNo:Long):Observable<ResultEntity<String>>

    @GET("account/get")
    fun accountMoney():Observable<ResultEntity<AccountInfoBean>>

    @GET("account/transactionRecord")
    fun accountRecorder(@Query("page")page:Int,@Query("limit")limit:Int):Observable<ResultEntity<AccountListBean>>
}
